home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / DJDEV111.ZIP / include / gppconio.h < prev    next >
C/C++ Source or Header  |  1993-08-29  |  3KB  |  115 lines

  1. /**********************************************************************
  2.  *  
  3.  *  NAME:           gppconio.h
  4.  *  
  5.  *  DESCRIPTION:    simulate Borland text video funcs for GNU C++
  6.  *  
  7.  *  copyright (c) 1991 J. Alan Eldridge
  8.  * 
  9.  *  M O D I F I C A T I O N   H I S T O R Y
  10.  *
  11.  *  when        who                 what
  12.  *  -------------------------------------------------------------------
  13.  *  10/27/91    J. Alan Eldridge    created
  14.  *  
  15.  *********************************************************************/
  16.  
  17. #ifndef __GPPCONIO_H
  18. #define __GPPCONIO_H
  19.  
  20. #if defined(__TURBOC__)
  21. #error  Use conio.h for Borland compilers!
  22. #endif
  23.  
  24. extern int directvideo; /* ignored by gppconio */
  25.  
  26. #define _NOCURSOR      0
  27. #define _SOLIDCURSOR   1
  28. #define _NORMALCURSOR  2
  29.  
  30. struct text_info {
  31.     unsigned char winleft;
  32.     unsigned char wintop;
  33.     unsigned char winright;
  34.     unsigned char winbottom;
  35.     unsigned char attribute;
  36.     unsigned char normattr;
  37.     unsigned char currmode;
  38.     unsigned char screenheight;
  39.     unsigned char screenwidth;
  40.     unsigned char curx;
  41.     unsigned char cury;
  42. };
  43.  
  44. enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
  45.  
  46. enum COLORS {
  47.     /*  dark colors     */
  48.     BLACK,          
  49.     BLUE,
  50.     GREEN,
  51.     CYAN,
  52.     RED,
  53.     MAGENTA,
  54.     BROWN,
  55.     LIGHTGRAY,
  56.     /*  light colors    */
  57.     DARKGRAY,
  58.     LIGHTBLUE,
  59.     LIGHTGREEN,
  60.     LIGHTCYAN,
  61.     LIGHTRED,
  62.     LIGHTMAGENTA,
  63.     YELLOW,
  64.     WHITE
  65. };
  66.  
  67. #define BLINK   0x80    /*  blink bit   */
  68.  
  69. #ifdef  __cplusplus
  70. extern "C" {
  71. #endif
  72.  
  73. void    clreol(void);
  74. void    clrscr(void);
  75. void    gotoxy(int x, int y);
  76. int     wherex(void);
  77. int     wherey(void);
  78. int     putch(int c);
  79. int     getch(void);
  80. int     getche(void);
  81. int     ungetch(int); 
  82. int     kbhit(void);
  83. int     _conio_kbhit(void); /* checks for ungetch char */
  84. void    delline(void);
  85. int     gettext(int left, int top, int right, int bottom, void *destin);
  86. void    gettextinfo(struct text_info *r);
  87. void    highvideo(void);
  88. void    insline(void);
  89. void    lowvideo(void);
  90. int     movetext(int left, int top, int right, int bottom, 
  91.             int destleft, int desttop);
  92. void    normvideo(void);
  93. int     puttext(int left, int top, int right, int bottom, void *source);
  94. void    textattr(int attr);
  95. void    textbackground(int color);
  96. void    textcolor(int color);
  97. void    textmode(int unused_mode);
  98. void    window(int left, int top, int right, int bottom);
  99. void    _setcursortype(int unused_type);
  100. char    *cgets(char *str); 
  101. int     cprintf(const char *format, ...);
  102. int     cputs(const char *str);
  103. int     cscanf(const char *format, ...); 
  104. /* char    *getpass(const char *prompt); */
  105. void gppconio_init(void);
  106.  
  107. #ifdef  __cplusplus
  108. }
  109. #endif
  110.  
  111. #define kbhit _conio_kbhit /* Who ever includes gppconio.h probably
  112.                               also wants _conio_kbhit and not kbhit
  113.                               from libc */
  114. #endif
  115.